﻿<Controls1:ChromeWindow x:Class="WpfRcp.Views.Windows.MessageBoxWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls1="clr-namespace:WpfRcp.Controls;assembly=WpfRcp.Controls"
    xmlns:Helpers1="clr-namespace:WpfRcp.Helpers"
    Title="{Binding Title}" SizeToContent="Height" Width="450" WindowStartupLocation="CenterScreen" 
    Background="{DynamicResource WindowBackground}" Style="{StaticResource SingleChromeWindowStyleKey}"
    Icon="{Binding RcpSettings.WindowIcon}">
    
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
        <BitmapImage x:Key="WarningIcon" UriSource="../../Resources/Images/warning.png" />
        <BitmapImage x:Key="AcceptIcon" UriSource="../../Resources/Images/accept.png" />
        <BitmapImage x:Key="HelpIcon" UriSource="../../Resources/Images/help.png" />
        <BitmapImage x:Key="InfoIcon" UriSource="../../Resources/Images/info.png" />
        <BitmapImage x:Key="ErrorIcon" UriSource="../../Resources/Images/remove.png" />
    </Window.Resources>

    <DockPanel Margin="10">
        <StackPanel x:Name="m_ButtonsPanel" DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="0,5,0,0" HorizontalAlignment="Right">
            <Button Content="{Binding Source={x:Static Helpers1:ResHelper.Instance}, Path=Resource[Yes]}" Command="{Binding YesCommand}" Width="75" Visibility="{Binding ButtonYesVisible, Converter={StaticResource booleanToVisibilityConverter}}" IsDefault="{Binding ButtonYesVisible}" ></Button>
            <Button Content="{Binding Source={x:Static Helpers1:ResHelper.Instance}, Path=Resource[No]}" Command="{Binding NoCommand}" Width="75" Margin="5,0,0,0" Visibility="{Binding ButtonNoVisible, Converter={StaticResource booleanToVisibilityConverter}}"></Button>
            <Button Content="{Binding Source={x:Static Helpers1:ResHelper.Instance}, Path=Resource[OK]}" Command="{Binding OkCommand}" Width="75" Margin="5,0,0,0" Visibility="{Binding ButtonOkVisible, Converter={StaticResource booleanToVisibilityConverter}}" IsDefault="{Binding ButtonOkVisible}"></Button>
            <Button Content="{Binding Source={x:Static Helpers1:ResHelper.Instance}, Path=Resource[Cancel]}" Command="{Binding CancelCommand}" Width="75" Margin="5,0,0,0" Visibility="{Binding ButtonCancelVisible, Converter={StaticResource booleanToVisibilityConverter}}" IsCancel="{Binding ButtonCancelVisible}"></Button>
        </StackPanel>
        
        <DockPanel>
            <Image x:Name="m_Image" DockPanel.Dock="Left" Width="64" Height="64" Margin="0,0,10,0" />
            <TextBlock TextWrapping="Wrap" Text="{Binding Message}" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </DockPanel>
    </DockPanel>

</Controls1:ChromeWindow>